#include "volar.h"

#include <app_config.h>
#include <pubsub.h>

Volar::Volar() {
    this->log = LogUtil::getLogger("plugin-volar");
}

QString Volar::pluginName() {
    return "volar";
}
QString Volar::pluginVersion() {
    return AppConfig::getInstance()->appVersion();
}
QString Volar::author() {
    return "janna";
}

QMap<QString, QVariant> Volar::handler(const JannaTopic& topic, const QMap<QString, QVariant>& param) {
    if ("janna" == topic.source && "echo-volar" == topic.topic) {
        SPDLOG_LOGGER_DEBUG(this->log, fmt::format("plugin-volar ===> message is : {}",
                                                   param.value("msg").toString().toStdString()));
        return QMap<QString, QVariant>();
    }
    return QMap<QString, QVariant>();
}
